#include <string>
using namespace std;

class Solution
{
public:
    string modifyString(string s)
    {
        int size = s.size();
        for (int i = 0; i < size; i++)
        {
            if ('?' == s[i])
            {
                for (char ch = 'a'; ch <= 'z'; ch++)
                {
                    if ((0 == i || ch != s[i - 1]) && (ch != s[i + 1] || size - 1 == i))//一并处理s的0索引处和s.size()-1索引处元素为'?'的情况
                    {
                        s[i] = ch;
                        break;
                    }
                }
            }
        }
        return s;
    }
};